package com.hankol.newretail.adapter.details

import android.widget.ImageView
import com.baselibrary.utils.GlideUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.newretail.R
import com.hankol.newretail.bean.MallLabelBean

/**
 * @author: 关忆北、
 * @date: 2022/8/4
 * @Des：
 */
class GoodsServerDesAdapter : BaseQuickAdapter<MallLabelBean, BaseViewHolder>(R.layout.item_goods_det_server) {
    override fun convert(helper: BaseViewHolder, item: MallLabelBean) {
        helper.setText(R.id.tv_goods_det_server_title, item.name).setText(R.id.tv_goods_det_server_des, item.description)
        val tvServerLabel = helper.getView<ImageView>(R.id.tv_goods_det_server_label)
        GlideUtils.loadImg_228(mContext.applicationContext, item.icon, tvServerLabel)

        if (helper.adapterPosition == itemCount - 1) {
            helper.setGone(R.id.view_goods_det_server_line, false)
        } else {
            helper.setGone(R.id.view_goods_det_server_line, true)
        }
    }

}